package com.scmt.hmzd.yx;

import com.winnerlook.model.PrivacyBindBodyAx;
import com.winnerlook.model.VoiceResponseResult;
import com.winnerlook.service.VoiceSender;

public class YxUtils {
    public static void testAx() {
        /*请修改为平台分配的accountId*/
        String accountId="159710";
        /*请修改为平台分配的token*/
        String token="207987fece4b473a94446a04dbde7f46";
        PrivacyBindBodyAx message = new PrivacyBindBodyAx();
        /*请修改为平台分配的小号号码,必填*/
        message.setMiddleNumber("13018042940");
        /*需要绑定的真实号码telA,必填*/
        message.setBindNumberA("15228201176");
        /*需要绑定的真实号码telA对应的姓名,必填*/
       // message.setCalleeName("");
        /*需要绑定的真实号码telA对应的身份证号码,必填*/
       // message.setCalleeId("");
        /*是否需要录音，1：录音；0：不录音*/
        message.setCallRec(0);
        /*绑定时间，单位秒,默认为永久绑定*/
        message.setMaxBindingTime(120);
        /*测试AX模式时，务必填2*/
        message.setMode(2);
        /*需要自动解绑的号码A,非必须*/
        //message.setAutoUnbindNumberA("");
        /*第三方呼叫号码A时，是否将主叫号码透传给A,1:透传；0:不透传*/
        message.setPassthroughCallerToA(0);

        message.setWithExtNumber(1);

        try {
            long start = System.currentTimeMillis();
            VoiceResponseResult result = VoiceSender.httpPrivacyBindAx(message, accountId, token);
            long end = System.currentTimeMillis();
            System.out.println("duration = " + (end-start));
            System.out.println("result = " + result);
        }catch (Exception e) {
            //Log.e(this.getClass(), " e = " + e);
            e.printStackTrace();
        }
    }
}
